quadrilateral distance relay calculation